package org.lagou.resultsethandler;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.ResultSetHandler;
import org.lagou.bean.TypeBean;

public class TypeBeanResultSetHandler implements ResultSetHandler<List<TypeBean>>{

	@Override
	public List<TypeBean> handle(ResultSet rs) throws SQLException {
		List<TypeBean> list=new ArrayList<TypeBean>();
		
		while (rs.next()) {
			TypeBean info=new TypeBean();
			info.setId(rs.getInt("id"));
			info.setName(rs.getString("name"));
			info.setSuperiorid(rs.getInt("superiorid"));
			info.setShow1(rs.getInt("show1"));
			info.setHot(rs.getInt("hot"));
			info.setDate(rs.getString("date"));
			list.add(info);
		}
		return list;
	}
	}

